package com.burstly.lib.network.request;

import android.util.Log;
import com.burstly.lib.util.LoggerExt;
import com.burstly.lib.util.Utils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.methods.HttpPost;

public class SingleHostRequest<T> extends AbortableAsyncTask<T>
{
  private static final LoggerExt LOG = LoggerExt.getInstance();
  private Thread mWorkerThread;

  public SingleHostRequest(String paramString1, String paramString2)
  {
    super(paramString1, paramString2);
  }

  public void abortRequest()
  {
    super.abortRequest();
    if (this.mWorkerThread != null)
      this.mWorkerThread.interrupt();
  }

  protected T convertServerResponse(String paramString)
  {
    return null;
  }

  protected Thread getWorkerThread()
  {
    return this.mWorkerThread;
  }

  protected String makeRequest()
  {
    String str1;
    if ((RequestManager.isOnline()) && (!isAborted()))
    {
      str1 = "SingleHostRequest of " + getBurstlyViewId();
      this.mWorkerThread = Thread.currentThread();
    }
    try
    {
      String str2 = getUri();
      HttpResponse localHttpResponse = Utils.makeGetRequest(str2);
      int i = localHttpResponse.getStatusLine().getStatusCode();
      long l = localHttpResponse.getEntity().getContentLength();
      LoggerExt localLoggerExt = LOG;
      Object[] arrayOfObject = new Object[3];
      arrayOfObject[0] = Integer.valueOf(i);
      arrayOfObject[1] = Long.valueOf(l);
      arrayOfObject[2] = str2;
      localLoggerExt.logDebug(str1, "Status code {0}, length {1}, url: {2}", arrayOfObject);
      return null;
    }
    catch (Exception localException)
    {
      while (true)
        LOG.logWarning(str1, Log.getStackTraceString(localException), new Object[0]);
    }
  }

  protected void setWorkerThread(Thread paramThread)
  {
    this.mWorkerThread = paramThread;
  }

  protected String tryToConnect(HttpHost paramHttpHost, HttpPost paramHttpPost)
  {
    return null;
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.network.request.SingleHostRequest
 * JD-Core Version:    0.6.2
 */